/*
 * Created by LiuYou on 2020/11/27.
 *
 */

#ifndef EFFECTIVECPP_COMPUTER_HPP
#define EFFECTIVECPP_COMPUTER_HPP


#include <memory>

/******************************************************************************
/// 成功！！！！前置声明要声明正确，因为 GraphicsCard类在命名空间 GraphicsCard_内，所以
/// 前置声明时，一定要使用命名空间！！！！
 namespace GraphicsCard_ {
    class GraphicsCard;
}
/// 而且 class GraphicsCard_::GraphicsCard; 是错误的！！！！
 ******************************************************************************/

namespace GraphicsCard_ {
    class GraphicsCard;
}

/// 错误！！！！
//class GraphicsCard_::GraphicsCard;

namespace Computer_ {
    class ComputerImpl;


    class Computer {
    public:
        explicit Computer(const GraphicsCard_::GraphicsCard& graphicsCard);

        virtual ~Computer();

        const GraphicsCard_::GraphicsCard& getGraphicsCard() const;

        friend std::ostream& operator<<(std::ostream& os, const Computer& computer);

    private:
        std::shared_ptr<ComputerImpl> pImpl;
    };

}


#endif //EFFECTIVECPP_COMPUTER_HPP
